package madoop.reign;

import java.util.ArrayList;
import java.util.List;
import java.util.Properties;


public class Application
{
    String   name;
    String[] classpath;


    public Application(String name, String cp)
    {
        this.name = name;
        List<String> paths = new ArrayList<String>();
        if (cp != null) {
            for (String path : cp.split(":")) {
                path = path.trim();
                if (path.length() == 0)
                    continue;
                paths.add(path);
            }
        }
        classpath = paths.toArray(new String[0]);
    }


    public Application(Properties prop)
    {
        this(prop.getProperty("application.name"), prop.getProperty("application.classpath"));
    }
}
